<%@ include file="/WEB-INF/jsp/fragments/includes.jspf"%>
<%@ include file="/WEB-INF/jsp/fragments/header_top.jspf"%>

<title>Edit Product page</title>

<%@ include file="/WEB-INF/jsp/fragments/header_bottom.jspf"%>

<body>
	<h1>Edit Product page</h1>

	<%@ include file="/WEB-INF/jsp/fragments/navigation.jspf"%>

	<spring:hasBindErrors name="product">
		<div class="error">
			<p>Not valid product value</p>
		</div>
	</spring:hasBindErrors>

	<c:url value="/product/edit/${product.id}" var="editProductUrl" />
	<form:form action="${editProductUrl}" commandName="product"
		method="POST">
		<ul>
			<li><form:label path="name">Name: </form:label> <form:input
					type="text" path="name" /> <form:errors path="name"
					cssClass="error" delimiter=", " /></li>
			<li><form:label path="units">Units: </form:label> <form:input
					type="text" path="units" /> <form:errors path="units"
					cssClass="error" delimiter=", " /></li>
			<li><form:label path="weight">Weight: </form:label> <form:input
					type="text" path="weight" /> <form:errors path="weight"
					cssClass="error" delimiter=", " /></li>
			<li><form:label path="additionDate">AdditionDate: </form:label>
				<form:input type="text" path="additionDate" /> <form:errors
					path="additionDate" cssClass="error" delimiter=", " /></li>
			<input type="submit" value="Update" />
		</ul>
	</form:form>

</body>
</html>
